<?php
namespace api\modules\v1\controllers;

use common\core\base\BaseApiActiveController;
use api\modules\v1\resources\UserGroup;
use yii\data\ActiveDataProvider;
/**
 * Class UserGroupController
 *
 * @author Xuegui Yuan <yuanxuegui@163.com>
 */
class UserGroupController extends BaseApiActiveController
{

    /**
     * @inheritdoc
     * @var string
     */
    public $modelClass = 'api\modules\v1\resources\UserGroup';

    public function actionRecommend()
    {
        $query = UserGroup::find()->recommend();

        $dataProvider = new ActiveDataProvider([
            'query' => $query,
        ]);

        return $dataProvider;
    }
}
